<template>
  <div>
    <van-sticky :offset-top="0" class="van-sticky-box">
      <van-search
        v-model="value"
        shape="round"
        show-action
        placeholder="请输入搜索关键词"
        @search="onSearch"
      >
        <template #action>
          <div @click="onSearch">搜索</div>
        </template>
      </van-search>
    </van-sticky>
  </div>
</template>

<script>
import Vue from "vue";
import { Search, Sticky,Divider } from "vant";

Vue.use(Search);
Vue.use(Sticky);
Vue.use(Divider);
export default {
  data(){
    return{
      value:""
    }
  },
  methods: {
    onSearch() {
      this.$emit("search",this.value);
    }
  }
};
</script>

<style lang="less" scoped>
</style>
